package com.wholesale.beans;

import org.json.JSONException;
import org.json.JSONObject;

public class OrderDetail {

	private int goodsId ;
	private int orderId ;
	private String goodsSn ;
	private String goodsName ;
	private int goodsNumber ;
	private double marketPrice ;
	private double goodsPrice ;
	private int goodsIntegral ;
	private String goodsAttr ;
	private int goodsPrize ;
	private String goodsMemo ;
	private int sendNumber ;
	private boolean isReal ;
	private String extensionCode ;
	private int parentId ;
	private boolean isGift ;
	private JSONObject jsonObject;
	public JSONObject getJSONObject() {
		return jsonObject;
	}
	public int getGoodsId() {
		return goodsId;
	}
	public void setGoodsId(int goodsId) {
		this.goodsId = goodsId;
	}
	public int getOrderId() {
		return orderId;
	}
	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}
	public String getGoodsSn() {
		return goodsSn;
	}
	public void setGoodsSn(String goodsSn) {
		this.goodsSn = goodsSn;
	}
	public String getGoodsName() {
		return goodsName;
	}
	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}
	public int getGoodsNumber() {
		return goodsNumber;
	}
	public void setGoodsNumber(int goodsNumber) {
		this.goodsNumber = goodsNumber;
	}
	public double getMarketPrice() {
		return marketPrice;
	}
	public void setMarketPrice(double marketPrice) {
		this.marketPrice = marketPrice;
	}
	public double getGoodsPrice() {
		return goodsPrice;
	}
	public void setGoodsPrice(double goodsPrice) {
		this.goodsPrice = goodsPrice;
	}
	public int getGoodsIntegral() {
		return goodsIntegral;
	}
	public void setGoodsIntegral(int goodsIntegral) {
		this.goodsIntegral = goodsIntegral;
	}
	public String getGoodsAttr() {
		return goodsAttr;
	}
	public void setGoodsAttr(String goodsAttr) {
		this.goodsAttr = goodsAttr;
	}
	public int getGoodsPrize() {
		return goodsPrize;
	}
	public void setGoodsPrize(int goodsPrize) {
		this.goodsPrize = goodsPrize;
	}
	public String getGoodsMemo() {
		return goodsMemo;
	}
	public void setGoodsMemo(String goodsMemo) {
		this.goodsMemo = goodsMemo;
	}
	public int getSendNumber() {
		return sendNumber;
	}
	public void setSendNumber(int sendNumber) {
		this.sendNumber = sendNumber;
	}
	public boolean isReal() {
		return isReal;
	}
	public void setReal(boolean isReal) {
		this.isReal = isReal;
	}
	public String getExtensionCode() {
		return extensionCode;
	}
	public void setExtensionCode(String extensionCode) {
		this.extensionCode = extensionCode;
	}
	public int getParentId() {

		return parentId;
	}
	public void setParentId(int parentId) {
		this.parentId = parentId;
	}
	public boolean isGift() {
		return isGift;
	}
	public void setGift(boolean isGift) {
		this.isGift = isGift;
	}
	public void jsonAnalytic(String jsonString){
		try {
			jsonObject = new JSONObject(jsonString);
			jsonAnalytic(jsonObject);
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void jsonAnalytic(JSONObject jsonObject){
		this.jsonObject = jsonObject;
		
			try {
				goodsId = jsonObject.getInt("goodsId");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				orderId = jsonObject.getInt("orderId");
			} catch (JSONException e1) {
				e1.printStackTrace();
			}
			try {
				goodsSn = jsonObject.getString("goodsSn");
			} catch (JSONException e1) {
				e1.printStackTrace();
			}
			try {
				goodsName = jsonObject.getString("goodsName");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				goodsNumber = jsonObject.getInt("goodsNumber");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				marketPrice = jsonObject.getDouble("marketPrice");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				goodsPrice = jsonObject.getDouble("goodsPrice");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				goodsIntegral = jsonObject.getInt("goodsIntegral");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				goodsAttr = jsonObject.getString("goodsAttr");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				goodsPrize = jsonObject.getInt("goodsPrize");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				goodsMemo = jsonObject.getString("goodsMemo");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				sendNumber = jsonObject.getInt("sendNumber");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				isReal = jsonObject.getBoolean("isReal");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				extensionCode = jsonObject.getString("extensionCode");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				parentId = jsonObject.getInt("parentId");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				if(!jsonObject.getString("isGift").equals("") && jsonObject.getString("isGift").equals("1")){
					isGift = true ;
				}
			} catch (JSONException e) {
				e.printStackTrace();
			}
		
	}
}
